<?php

namespace App\Http\Resources\Admins;

use Illuminate\Http\Resources\Json\JsonResource;

class UserCouponResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id'        => $this['id'],
            'name'      => $this['user']['name'],
            'mobile'    => $this['user']['mobile'],
            'value'     => $this['value'],
            'deadline'  => $this['deadline'],
            'type'      => $this['coupon']['type'],
            'created_at'=> $this['created_at'],
        ];
    }
}
